package org.funtester.performance.books.chapter04.section2;

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * HttpGet请求携带body参数
 */
public class HttpGetWithBody extends HttpEntityEnclosingRequestBase {

    static final String METHOD_NAME = "GET";

    /**
     * 获取方法类型（必须重载）
     *
     * @return
     */
    @Override
   public String getMethod() {
        return METHOD_NAME;
    }

    /**
     * 创建HttpGetWithBody对象
     * @param uri
     */
    public HttpGetWithBody(final String uri) throws URISyntaxException {
        this(new URI(uri));
    }

    /**
     * 创建HttpGetWithBody对象
     * @param uri
     */
    public HttpGetWithBody(final URI uri) {
        super();
        setURI(uri);
    }

    public HttpGetWithBody() {
        super();
    }
}
